<?php if(!$current_user_id){header('Location:/users/login');exit;} ?><!DOCTYPE html>
<html lang="zh-cn">
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8"> 
<meta charset="utf-8">
<base target="_top"/>
<meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1">
<meta name="renderer" content="webkit">
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
<link rel="apple-touch-icon" href="/apple-touch-icon.png" />
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<meta http-equiv="x-rim-auto-match" content="none">
<title>135编辑器,微信编辑器，微信排版,图文排版,一键秒刷,公众号图文编辑器,排版编辑器，文章排版，内容编辑器，在线使用无需下载。135编辑器，从1开始，做更好</title>
<meta name="Keywords" content="135编辑器，微信编辑器，微信图文编辑器，排版编辑器，文章排版，微信图文美化编辑器，135编辑器下载,微信排版工具，微信公众号内容编辑，图文排版工具，最方便的微信编辑器，135编辑器官网" />
<meta name="Description" content="135微信编辑器，微信图文素材排版编辑器提供美化微信文章排版，微信公众号内容编辑的功能，样式丰富，“秒刷”一键排版，轻松编辑非常美观的微信图文消息。支持收藏样式、收藏颜色、图片素材编辑，图片水印等个性化功能。" />

<link rel="stylesheet" type="text/css" href="/css/font-awesome.min.css" />
<link rel="stylesheet" type="text/css" href="/css/jquery.jgrowl.css" />
<link rel="stylesheet" type="text/css" href="/cache/bootstrap_2.css" />
<link rel="stylesheet" type="text/css" href="/css/mobile.css" />
<script type="text/javascript" src="/js/umeditor/third-party/jquery.min.js"></script>
<script type="text/javascript" src="/js/jquery/jquery.cookie.js"></script>
<script type="text/javascript" src="/js/jquery/jquery.lazyload.js"></script>
<script type="text/javascript" src="/js/jquery/jquery.jgrowl.min.js"></script>
<script type="text/javascript" src="/js/bootstrap.min.js"></script>
<script type="text/javascript" src="/js/common.js"></script>
<script type="text/javascript" src="/js/front.js"></script>

<script type="text/javascript" src="/js/mobile_editor.js"></script>
<style>

._135editor {border:0 none;padding: 0px;position: relative;}
._135editor.active{z-index: 1;}
._135editor  .draghandle{position: absolute;background-color:rgba(200,200,200,0.8);color:#333;cursor: move;top:-30px;right:-5px;padding: 3px 5px;font-size:12px;}
article {margin: 10px 10px 85px;}
article .active-135item{position: relative;}
article .active-135item:before {
    position: absolute;
    content: ''; left: 0;right: 0;top: 0;bottom: 0;
    box-sizing: border-box;
    border: 2px dashed red;margin:-5px;z-index: 1000;
}
[contenteditable]{
-webkit-tap-highlight-color:rgba(0,0,0,0);
-webkit-user-modify:read-write-plaintext-only;
outline:0;
}
a:hover, a:focus {color: #157ab5;text-decoration: none;}
#toolbar .btn{padding:2px 3px;}
.concern-cart{width:80%;}.action-list{width: 20%;}
.concern-cart a{width:20%;}
#mp-styles{margin: 10px 5px 5px;overflow: initial;}
#mp-styles .modal-dialog{width:100%;margin:0;max-width: 100%;}
#mp-styles .modal-header h3{display: none;}
#mp-styles .modal-body{width:100%;margin: 0;padding: 0;}
#mp-styles .modal-header{padding: 0;border:0 none;z-index:1;top: -10px;position: absolute;right: 0;}
#mp-styles button.close{opacity: 0.9;color:red;padding: 0 5px;font-size: 28px;}
.modal,.modal-backdrop{bottom: 52px;}
.modal-backdrop.in{z-index: 1001;}
.progress{height:2px;margin-bottom: 2px;}
.a-upload {
    position: relative;
    cursor: pointer;
    overflow: hidden;
    display: inline-block;
}
.a-upload  input[type="file"] {
    position: absolute;
    font-size: 20px;display: inline-block;
    width: 80px;
    right: 0;
    top: 0;
    opacity: 0;
    filter: alpha(opacity=0);
    cursor: pointer
}
.chuangkit-design-button{display: none;}
h3, .h3 {
    font-size: 16px;
    margin: 0;
}
.col-sm-10{padding-right:10px !important;}
.pr{max-height: 300px;position:relative;overflow: hidden;}
.tpl-mask{display: block !important; position: absolute; top: 0;background: rgba(0,0,0,0.6); color: white;width: 100%;text-align: center;height: 100%;}
.open-tpl-brush{display: none;}
.change-btn{
    position: absolute;
    width: 45px;
    height: 45px;
    line-height: 45px;
    background: rgba(60,60,60,0.9);
    text-align: center;
    border-radius: 100%;
    color: #FFF;
    font-weight: bold;
}
</style>
<script>
var PLAT135_URL = BASEURL = '';

function getEditorHtml(){
    $('article.article135').find('_135editor').each(function(){
        $(this).removeClass('active');
        $(this).find('.tool-border').remove();
    });
    return $('article.article135').prop("innerHTML");
}

function saveWxMsg(form){
    
    var postdata = $(form).serializeArray();    
    // 将内容追加到提交的数据中
    postdata[postdata.length] = { name:'data[WxMsg][content]',value: getEditorHtml(true) };
    
    ajaxAction(form.action,postdata,form,function(request){
        //alert(1);
        current_edit_msg_id = request.id;
        publishController.close_dialog();
        $('#save-wx-msg-dialog').modal('hide');$('.modal-backdrop').remove();   //期间可能弹出了其它的dialog  
        if(request.ret == 0 ){
            showSuccessMessage(request.msg,'center');
        }
    });
    return false;
    
}
var current_media_id = null,current_media_idx=null,current_edit_msg_id = null;
function opensave(){
    var url;
    if(current_media_id != null && current_media_idx != null) {
        url = '/wx_msgs/save?inajax=1&rethtml=1&mid='+current_media_id +'&idx='+current_media_idx;
    }
    else if(current_edit_msg_id) {
        url = '/wx_msgs/save/'+current_edit_msg_id+'?inajax=1&rethtml=1';
    }
    else{
        url = '/wx_msgs/save?inajax=1&rethtml=1';
    }
    publishController.open_dialog(url,{title:'保存图文',id:'save-wx-msg-dialog','width':900,'callback':function(dialog){
        //$('#save-wx-msg').click();
        //alert(dialog.find('.modal-body').text());
        var text = dialog.find('.modal-body').text();
        var height = $(window).height();
        dialog.find('.modal-body').css('max-height',height-60)
        
        var regTest = new RegExp("您没有权限进行此项操作");
        
        if( regTest.test(text) ){
            
            //showErrorMessage('没有权限保存消息，只能保存三个模板.付费后可无限制保存消息');
            
            //dialog.modal('hide');
            
            //$('#myModal').modal('show');
            /*$('#dialog-save-template').unbind('click').click(function(){
                if($('#dialog-template-name').val() == ""){
                    $('#dialog-template-name').focus();
                }
                else{
                    $('#template_name').val($('#dialog-template-name').val());
                    form.action = '/user_styles/saveTemplate';
                    ajaxSubmitForm(form,function(request){
                        $('#myModal').modal('hide');
                        showSuccessMessage(request.msg);
                    });
                }       
            });*/
        }
    }});
    
    var $dialogid = publishController.dialogid;
    $('#'+$dialogid).on('hidden.bs.modal', function (e) {
            $('#'+$dialogid).remove();
    });
}

$(function(){
    $("#uploadImage").change(function(e){
            var id = "upload";
            var u = new Html5Uploadfile(id);
            if(this.files[0]){
                $("#fileuploadinfo_upload").show();
            }            
            u.upload(this,{
                container:'#fileuploadinfo_upload',
                file_post_name: 'upload', 
                file_model_name:'WxMsg',
                upload_url: '/uploadfiles/upload',
                uploadComplete:function(evt){
                    var data=eval('(' + evt.target.responseText + ')');  
                    if(current_focus_img) {
                        $(current_focus_img).attr('src') = data.fspath; 
                        $(current_focus_img).removeAttr('data-src'); 
                        current_focus_img = null;
                    }
                    else{
                        $(active_item).after('<section class="_135editor"><p style="text-align:center;"><img src="'+data.fspath+'"></p></section>'); 
                    }
                    // $('#'+data.fieldid).val(data.fspath);
                    $("#fileuploadinfo_upload").empty().hide();
                },
                no_db:'0',
                data_id:'',
                item_css:'',
                save_folder:'',
                return_type:'json'
            });
    })
}); 
</script>
</head>
<body style="overflow-y:auto;overflow-x:auto;margin:0;padding:0;background-size: cover !important;" oncontextmenu="return false;">

<article class="article135" id="main">
    <section id="new-focus-blank" data-role="paragraph" contenteditable="true" class="_135editor active" style="border: 0px none; padding: 0px;"><p><br/></p></section>
</article>

<div style="padding: 0 10px;position:fixed;height:32px;width:100%;bottom:80px;z-index: 100;font-size: 12px;background: rgba(255,255,255,0.8);display:none;" id="fileuploadinfo_upload">
    
</div>



<div id="toolbar" style="position:fixed;height:32px;background:#f8f8f8;line-height:32px;width:100%;bottom:50px;overflow-x:auto;z-index: 100;">
    <div style="width:600px;">
    
    <a href="javascript:;" class="a-upload btn btn-default">传图<input id="uploadImage" accept="image/*" type="file" name="upload" onchange=""></a>
    <a id="afterBlank" class="btn btn-default">后空行</a>
    <a id="beforeBlank" class="btn btn-default">前空行</a>
    <!-- <a id="focusBlank" class="btn btn-default">光标空行</a> -->
    <a id="moveUp" class="btn btn-default">上移</a>
    <a id="moveDown" class="btn btn-default">下移</a>
    <a id="delete" class="btn btn-default">删除</a>
    <a id="copy" class="btn btn-default">复制</a>
    <a id="insert-copy" class="btn btn-default">插入</a>
    </div>
</div>
<div id="fix-footer" class="cart-concern-btm-fixed">
    <div class="concern-cart">
            <a id="op-styles" class="dong-dong-icn J_ping">
                <i class="fa fa-plus"></i>
                <span class="focus-info">样式</span>
            </a>
        <a  id="op-templates" class="love-heart-icn J_ping" >
            <i class="fa fa-newspaper-o"></i>
            <span class="focus-info"> 模板  </span>
        </a>
        <a href="/wx_msgs/mine" class="love-heart-icn J_ping" >
            <i class="fa fa-user"></i>
            <span class="focus-info"> 我的  </span>
        </a>
        <!-- <a  id="op-preview" class="love-heart-icn J_ping" >
            <i class="fa fa-tags"></i>
            <span class="focus-info"> 预览  </span>
        </a> -->
                
    </div>
    <div class="action-list">
        <a id="op-save" class="red-color baoming-btn directorder" onclick="opensave();">
            保存
        </a>
    </div>
</div>

<div class="modal fade" id="edit-textnode" tabindex="-1" role="dialog"  aria-hidden="true" style="bottom: 0px;z-index:100000;">
    <div class="modal-dialog"  style="">
    <div class="modal-content">
      <div class="modal-header" style="border:0 none">
        <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">{{__('Close')}}</span></button>
        <h4 class="modal-title">编辑文字</h4>
      </div>
     <div class="modal-body" style="padding: 0;margin: 10px;">
        <textarea class="form-control" rows="3" style="width:100%;" ></textarea>
     </div>
     <div class="modal-footer">
        <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
        <button type="button" class="btn btn-confirm btn-primary">确定</button>
      </div>
     </div>
     </div>
</div>
</body>
</html>